<?php
//验证cookie是否存在
//inc/cookies
//By QINIAO

ob_start();
$username =isset( $_COOKIE['username']) ? $_COOKIE['username'] : '';
$password = isset($_COOKIE['password']) ? $_COOKIE['password'] : '';
$cookieresult = mysql_query("select * from qi_users where username='$username' and password='$password'");
$cookienum = mysql_num_rows($cookieresult);
if(!empty($cookienum))
{
$user=mysql_fetch_array($cookieresult);
$uid=$user['id'];
$tname=$user['truename'];
$admin=$user['isadmin'];
$usite=$user['site'];
$uabout=$user['about'];
$usex=$user['sex'];
}
?>